﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;

namespace TravelGenerator.BusinessObjects.ObjectValidator
{
    /// <summary>
    /// Class allows you to save Check Result Object
    /// </summary>
    public class CheckResult
    {
        #region Properties

        private string _message;
        /// <summary>
        /// Gets or sets the message.
        /// </summary>
        /// <value>The message.</value>
        public string Message
        {
            get
            {
                return this._message;
            }
            private set
            {
                this._message = value;
            }
        }

        private TraceLevel _levelTrace;
        /// <summary>
        /// Gets or sets the level trace.
        /// </summary>
        /// <value>The level trace.</value>
        public TraceLevel LevelTrace
        {
            get
            {
                return this._levelTrace;
            }
            private set
            {
                this._levelTrace = value;
            }
        }

        private int? _idError;
        /// <summary>
        /// Gets or sets the id error.
        /// </summary>
        /// <value>The id error.</value>
        public int? IdError
        {
            get
            {
                return this._idError;
            }
            private set
            {
                this._idError = value;
            }
        }

        #endregion

        #region Constructor

        /// <summary>
        /// Initializes a new instance of the <see cref="CheckResult"/> class.
        /// </summary>
        private CheckResult()
        {

        }

        #endregion

        #region Methods

        /// <summary>
        /// Creates the specified error.
        /// </summary>
        /// <param name="level">The level.</param>
        /// <param name="message">The message.</param>
        /// <param name="idError">The id error.</param>
        /// <returns></returns>
        public static CheckResult Create(TraceLevel level, string message, int? idError = null)
        {
            CheckResult cr = new CheckResult();
            cr.LevelTrace = level;
            cr.Message = message;
            cr.IdError = idError;

            return cr;
        }

        #endregion
    }
}
